File Directory Php

if(!$GlimpseDir) $GlimpseDir="/";
/* Set this directory to the physical location on your filesystem for
the document root. */
$basedir="/usr/httpd/html/glimpse";
function reloadnow() {
global $PHP_SELF;
global $addons;
header("Status: 302 Moved");
header("Location: $PHP_SELF".$addons);
exit(); }
if($cancel) $action="";
if($action=="root") $GlimpseDir="/";
if($action=="chdr") $GlimpseDir=$file."/";
if($action=="dele" && $confirm==1) { unlink($basedir.$file); $action="";}
if($action=="move" && $confirm && $newfile) {
rename($basedir.$file,$basedir.$newfile); $action=""; }
if($action=="rmdr") rmdir($basedir.$file);
if($action=="edit" && $confirm && $file) {
$fp=fopen($basedir.$file,"w");
fputs($fp,stripslashes($code));
fclose($fp);
$addons="?action=edit&file=".rawurlencode($file);
reloadnow(); }
if($upload) { copy($userfile,$basedir.$GlimpseDir.$userfile_name);
reloadnow(); }
if($touch) { touch($basedir.$GlimpseDir.$touchfile); reloadnow(); }
if($mkdir) { mkdir($basedir.$GlimpseDir.$mkdirfile,0700); reloadnow(); }
?>


Filesystem Browser-Current Directory="<?=$GlimpseDir;?>"

if ($action=="dele") {
echo "Are you sure you want to delete $file ?
";
echo "YES
";
echo "NO
";
echo "";
exit(); }
if ($action=="move") {
echo "Current Filename is: ".$file . "
\n";
echo "
\n";
echo "Newfile Name
\n";
echo "\n";
echo "\n";
echo "\n";
echo "\n";
echo "
";
exit(); }
if ($action=="edit") {
echo "
\n";
echo "Current Filename is: ".$file ." ";
echo "\n";
echo "\n";
echo "\n";
echo "
\n";
$fp=fopen($basedir.$file,"r");
$contents=fread($fp,filesize($basedir.$file));
echo "
\n";
echo "
";
exit(); }
?>
Back to root



while($file = readdir($handle)) {
if ($file != "." && $file != "..") {
$filename=$basedir.$GlimpseDir.$file;
$fileurl=rawurlencode($GlimpseDir.$file);
echo "";
echo "\n";
echo "\n";
echo "\n";
echo "";
echo "\n";
}
}
closedir($handle);
?>
FilenameTypeSizeAction
" . htmlspecialchars($file) . "" . filetype($filename) . "" . filesize($filename) . "";
if(filetype($filename)=="file") {
echo "View ";
echo "Edit ";
echo "Dele ";
echo "Move ";
} if(filetype($filename)=="dir") {
echo "ChDr ";
echo "RmDr ";
}
echo "